<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用 | Zeo's Security Lab</title><meta name="author" content="Zeo"><meta name="copyright" content="Zeo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用 内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用  0x01简单的木马打到一台PC  生成win的 Payload   0x02 beacon的介绍和使用  Beacon简介 Beacon">
<meta property="og:type" content="article">
<meta property="og:title" content="内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用">
<meta property="og:url" content="https://godzeo.github.io/2020/03/15/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt%20Strike-%E4%BA%8C-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8/index.html">
<meta property="og:site_name" content="Zeo&#39;s Security Lab">
<meta property="og:description" content="内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用 内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用  0x01简单的木马打到一台PC  生成win的 Payload   0x02 beacon的介绍和使用  Beacon简介 Beacon">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp">
<meta property="article:published_time" content="2020-03-15T10:59:19.000Z">
<meta property="article:modified_time" content="2022-11-28T12:25:22.943Z">
<meta property="article:author" content="Zeo">
<meta property="article:tag" content="WEB安全">
<meta property="article:tag" content="代码审计">
<meta property="article:tag" content="内网">
<meta property="article:tag" content="渗透">
<meta property="article:tag" content="二进制">
<meta property="article:tag" content="CTF">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp"><link rel="shortcut icon" href="/img/WX20211124-162855.png"><link rel="canonical" href="https://godzeo.github.io/2020/03/15/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt%20Strike-%E4%BA%8C-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-11-28 20:25:22'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="Zeo's Security Lab" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Zeo's Security Lab</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-03-15T10:59:19.000Z" title="发表于 2020-03-15 18:59:19">2020-03-15</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-28T12:25:22.943Z" title="更新于 2022-11-28 20:25:22">2022-11-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E7%A0%94%E7%A9%B6/">内网安全研究</a></span></div><div class="meta-secondline"></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><span id="more"></span>

<h1 id="内网安全学习从入门到入狱-神器-Cobalt-Strike2-Beacon简介和使用"><a href="#内网安全学习从入门到入狱-神器-Cobalt-Strike2-Beacon简介和使用" class="headerlink" title="内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用"></a>内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用</h1><h3 id="内网安全学习从入门到入狱-神器-Cobalt-Strike-二-Beacon简介和使用"><a href="#内网安全学习从入门到入狱-神器-Cobalt-Strike-二-Beacon简介和使用" class="headerlink" title="内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用"></a>内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用</h3><ul>
<li><a href="#Cobalt_Strike2Beacon_1">内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用</a></li>
<li><ul>
<li><a href="#0x01PC_18">0x01简单的木马打到一台PC</a></li>
<li><ul>
<li><a href="#win_Payload_28">生成win的 Payload</a></li>
</ul>
</li>
<li><a href="#0x02_beacon_50">0x02 beacon的介绍和使用</a></li>
<li><ul>
<li><a href="#Beacon_54">Beacon简介</a></li>
<li><a href="#Beacon_78">Beacon分类：</a></li>
<li><ul>
<li><a href="#http_beacon_86">http beacon</a></li>
<li><a href="#DNS_beacon_90">DNS beacon</a></li>
<li><a href="#SMB_beacon_106">SMB beacon</a></li>
</ul>
</li>
<li><a href="#beacon_116">进入beacon</a></li>
<li><a href="#_226">简单的命令执行</a></li>
<li><a href="#_252">最常用的修改心跳包</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/god_zzZ/article/details/104690519">内网安全学习从入门到入狱-工具-Cobalt Strike(cs)基础</a></p>
<p>上一次Cobalt Strike写到简单的介绍和启动服务和打开</p>
<ul>
<li>这一次我们写简单的木马生成以便介绍后续的功能</li>
<li>介绍一下beacon的作用和一下常用的操作</li>
</ul>
<h2 id="0x01简单的木马打到一台PC"><a href="#0x01简单的木马打到一台PC" class="headerlink" title="0x01简单的木马打到一台PC"></a>0x01简单的木马打到一台PC</h2><p>我们得有一个机子才能做后续的实验吧，所以</p>
<p>这算是获得了一个入口的机器</p>
<p>这才是一台win7来介绍一下beacon</p>
<h3 id="生成win的-Payload"><a href="#生成win的-Payload" class="headerlink" title="生成win的 Payload"></a>生成win的 Payload</h3><p>1、attacks-packages-Windows excutable</p>
<p><img src="https://img-blog.csdnimg.cn/20200315184828350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p>2、点击ADD，增加一个监听器</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185334141.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p>3、name随便写，host写服务器地址默认，端口自己定</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185322120.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p>4、点击save，出现一个exe，自己放到win7里面运行一下</p>
<p>5、主机上线</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185436213.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h2 id="0x02-beacon的介绍和使用"><a href="#0x02-beacon的介绍和使用" class="headerlink" title="0x02 beacon的介绍和使用"></a>0x02 beacon的介绍和使用</h2><h3 id="Beacon简介"><a href="#Beacon简介" class="headerlink" title="Beacon简介"></a>Beacon简介</h3><ul>
<li>那个作者说Beacon是Cobalt Strike运行在目标主机上的payload</li>
<li>翻译过来是叫信标，我觉得这个好理解</li>
<li>Beacon在隐蔽信道上我们提供服务，用于长期控制受感染主机**。**</li>
<li>它的工作方式与Metasploit Framework Payload类似</li>
<li>Beacon嵌入到可执行文件、添加到Word文档和一些漏洞 来传递Beacon</li>
</ul>
<p>执行我们的Payload后，即可发现目标机已经上线</p>
<blockquote>
<p><strong>Beacon有两种通信策略</strong>（与团队服务器通信-CS 中以团队服务器作为 C2）</p>
<ol>
<li><p><strong>异步式通信</strong> &#x3D; 异步模式下通信频率低、速度慢，如上图所示：Beacon会主动请求任务列表、然后进入SLEEP状态。</p>
</li>
<li><p><strong>交互式通信</strong> &#x3D; C2 对 Beacon 实时控制</p>
</li>
</ol>
</blockquote>
<h3 id="Beacon分类："><a href="#Beacon分类：" class="headerlink" title="Beacon分类："></a>Beacon分类：</h3><ol>
<li><p>HTTP and HTTPS Beacon</p>
</li>
<li><p>DNS Beacon</p>
</li>
<li><p>SMB Beacon</p>
</li>
</ol>
<h4 id="http-beacon"><a href="#http-beacon" class="headerlink" title="http beacon"></a>http beacon</h4><p>这个应该最简单，关键是Beacon通过GET请求来下载任务</p>
<h4 id="DNS-beacon"><a href="#DNS-beacon" class="headerlink" title="DNS beacon"></a>DNS beacon</h4><p>DNS Beacon在绕过防火墙 权限维持上非常有效</p>
<p>下面是主要流程，简单来说，就是靠dns解析找到你</p>
<p>整个配置过程非常简单，一条A记录和几条NS记录即可</p>
<p>配置A记录指向服务器ip ns记录都指向A记录域名</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185456824.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70"></p>
<h4 id="SMB-beacon"><a href="#SMB-beacon" class="headerlink" title="SMB beacon"></a>SMB beacon</h4><p>这种Beacon要求具有SMB Beacon的主机必须接受端口445上的连接。</p>
<p>派生一个SMB Beacon方法：</p>
<p>在Listner生成SMB Beacon&gt;目标主机&gt;右键&gt; spawn as&gt;选中对应的Listener&gt;上线</p>
<p>或在Beacon中使用命令<code>spawn 监听器</code></p>
<h3 id="进入beacon"><a href="#进入beacon" class="headerlink" title="进入beacon"></a>进入beacon</h3><p>1、右键目标interact来使用Beacon，我们用它来执行各种命令</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185512688.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70"></p>
<p>2、下放输入help 查看功能</p>
<p>Beacon中输入help来获取。</p>
<p><img src="https://img-blog.csdnimg.cn/20200315185620320.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p>在这贴出一部分汉化的命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br></pre></td><td class="code"><pre><span class="line">Beacon Commands</span><br><span class="line"> Command Description</span><br><span class="line"> ------- -----------</span><br><span class="line"> browserpivot 注入受害者浏览器进程</span><br><span class="line"> bypassuac 绕过UAC</span><br><span class="line"> cancel 取消正在进行的下载</span><br><span class="line"> cd 切换目录</span><br><span class="line"> checkin 强制让被控端回连一次</span><br><span class="line"> clear 清除beacon内部的任务队列</span><br><span class="line"> connect Connect to a Beacon peer over TCP</span><br><span class="line"> covertvpn 部署Covert VPN客户端</span><br><span class="line"> cp 复制文件</span><br><span class="line"> dcsync 从DC中提取密码哈希</span><br><span class="line"> desktop 远程VNC</span><br><span class="line"> dllinject 反射DLL注入进程</span><br><span class="line"> dllload 使用LoadLibrary将DLL加载到进程中</span><br><span class="line"> download 下载文件</span><br><span class="line"> downloads 列出正在进行的文件下载</span><br><span class="line"> drives 列出目标盘符</span><br><span class="line"> elevate 尝试提权</span><br><span class="line"> execute 在目标上执行程序(无输出)</span><br><span class="line"> execute-assembly 在目标上内存中执行本地.NET程序</span><br><span class="line"> exit 退出beacon</span><br><span class="line"> getprivs Enable system privileges on current token</span><br><span class="line"> getsystem 尝试获取SYSTEM权限</span><br><span class="line"> getuid 获取用户ID</span><br><span class="line"> hashdump 转储密码哈希值</span><br><span class="line"> help 帮助</span><br><span class="line"> inject 在特定进程中生成会话</span><br><span class="line"> jobkill 杀死一个后台任务</span><br><span class="line"> jobs 列出后台任务</span><br><span class="line"> kerberos_ccache_use 从ccache文件中导入票据应用于此会话</span><br><span class="line"> kerberos_ticket_purge 清除当前会话的票据</span><br><span class="line"> kerberos_ticket_use 从ticket文件中导入票据应用于此会话</span><br><span class="line"> keylogger 键盘记录</span><br><span class="line"> kill 结束进程</span><br><span class="line"> link Connect to a Beacon peer over a named pipe</span><br><span class="line"> logonpasswords 使用mimikatz转储凭据和哈希值</span><br><span class="line"> ls 列出文件</span><br><span class="line"> make_token 创建令牌以传递凭据</span><br><span class="line"> mimikatz 运行mimikatz</span><br><span class="line"> mkdir 创建一个目录</span><br><span class="line"> mode dns 使用DNS A作为通信通道(仅限DNS beacon)</span><br><span class="line"> mode dns-txt 使用DNS TXT作为通信通道(仅限D beacon)</span><br><span class="line"> mode dns6 使用DNS AAAA作为通信通道(仅限DNS beacon)</span><br><span class="line"> mode http 使用HTTP作为通信通道</span><br><span class="line"> mv 移动文件</span><br><span class="line"> net net命令</span><br><span class="line"> note 备注 </span><br><span class="line"> portscan 进行端口扫描</span><br><span class="line"> powerpick 通过Unmanaged PowerShell执行命令</span><br><span class="line"> powershell 通过powershell.exe执行命令</span><br><span class="line"> powershell-import 导入powershell脚本</span><br><span class="line"> ppid Set parent PID for spawned post-ex jobs</span><br><span class="line"> ps 显示进程列表</span><br><span class="line"> p**ec Use a service to spawn a session on a host</span><br><span class="line"> p**ec_psh Use PowerShell to spawn a session on a host</span><br><span class="line"> psinject 在特定进程中执行PowerShell命令</span><br><span class="line"> pth 使用Mimikatz进行传递哈希</span><br><span class="line"> pwd 当前目录位置</span><br><span class="line"> reg Query the registry</span><br><span class="line"> rev2self 恢复原始令牌</span><br><span class="line"> rm 删除文件或文件夹</span><br><span class="line"> rportfwd 端口转发</span><br><span class="line"> run 在目标上执行程序(返回输出)</span><br><span class="line"> runas 以另一个用户权限执行程序</span><br><span class="line"> runasadmin 在高权限下执行程序</span><br><span class="line"> runu Execute a program under another PID</span><br><span class="line"> screenshot 屏幕截图</span><br><span class="line"> setenv 设置环境变量</span><br><span class="line"> shell cmd执行命令</span><br><span class="line"> shinject 将shellcode注入进程</span><br><span class="line"> shspawn 生成进程并将shellcode注入其中</span><br><span class="line"> sleep 设置睡眠延迟时间</span><br><span class="line"> socks 启动SOCKS4代理</span><br><span class="line"> socks stop 停止SOCKS4</span><br><span class="line"> spawn Spawn a session </span><br><span class="line"> spawnas Spawn a session as another user</span><br><span class="line"> spawnto Set executable to spawn processes into</span><br><span class="line"> spawnu Spawn a session under another PID</span><br><span class="line"> ssh 使用ssh连接远程主机</span><br><span class="line"> ssh-key 使用密钥连接远程主机</span><br><span class="line"> steal_token 从进程中窃取令牌</span><br><span class="line"> timestomp 将一个文件时间戳应用到另一个文件</span><br><span class="line"> unlink Disconnect from parent Beacon</span><br><span class="line"> upload 上传文件</span><br><span class="line"> wdigest 使用mimikatz转储明文凭据</span><br><span class="line"> winrm 使用WinRM在主机上生成会话</span><br><span class="line"> wmi 使用WMI在主机上生成会话</span><br><span class="line"> argue 进程参数欺骗</span><br></pre></td></tr></table></figure>

<h3 id="简单的命令执行"><a href="#简单的命令执行" class="headerlink" title="简单的命令执行"></a>简单的命令执行</h3><p>Beacon中不能直接输入cmd命令，</p>
<p>如果让目标机执行ipconfig这条cmd命令，对应的Beacon命令是 <code>shell ipconfig</code></p>
<p>回显的命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">shell +command</span><br></pre></td></tr></table></figure>

<p>当前目录路径</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pwd</span><br></pre></td></tr></table></figure>

<p>使用powershell</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">powershell +command</span><br></pre></td></tr></table></figure>

<h3 id="最常用的修改心跳包"><a href="#最常用的修改心跳包" class="headerlink" title="最常用的修改心跳包"></a>最常用的修改心跳包</h3><ul>
<li>在Cobalt Strike中它的心跳默认是60s（即sleep时间为60s，每一分钟目标主机与teamserver通信一次）</li>
<li>这会让我们执行命令或进行其他操作响应很慢。</li>
<li>如果sleep时间过长，在下载文件面前更为明显，所以在测试时会把时间降低一点 。</li>
<li>我一般先执行sleep 5 ，让相应快一点，但是建议不要太快。如果有下载或者远程VNC这种需要快速网络的 可直接 sleep 0</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200315185635329.png"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://godzeo.github.io">Zeo</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://godzeo.github.io/2020/03/15/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt%20Strike-%E4%BA%8C-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8/">https://godzeo.github.io/2020/03/15/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt%20Strike-%E4%BA%8C-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://godzeo.github.io" target="_blank">Zeo's Security Lab</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/03/18/%E9%80%9A%E8%BE%BEOA%E5%89%8D%E5%8F%B0RCE%E5%8A%A0EXP%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0+%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB/"><img class="prev-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">通达OA前台RCE加EXP任意文件上传+文件包含</div></div></a></div><div class="next-post pull-right"><a href="/2020/03/14/%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%9F%A5%E8%AF%86-%E5%86%85%E7%BD%91%E4%BF%A1%E6%81%AF%E6%8E%A2%E6%B5%8B%E4%B8%8E%E6%94%B6%E9%9B%86/"><img class="next-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">内网安全学习从入门到入狱-知识-内网信息探测与收集</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Zeo</div><div class="author-info__description">专注于安全,分享生活,分享知识</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/godzeo"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/godzeo" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:zzzhhhaaaiiii@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">Weclome my blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt-Strike2-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8"><span class="toc-number">1.</span> <span class="toc-text">内网安全学习从入门到入狱-神器-Cobalt Strike2-Beacon简介和使用</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%86%85%E7%BD%91%E5%AE%89%E5%85%A8%E5%AD%A6%E4%B9%A0%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E7%8B%B1-%E7%A5%9E%E5%99%A8-Cobalt-Strike-%E4%BA%8C-Beacon%E7%AE%80%E4%BB%8B%E5%92%8C%E4%BD%BF%E7%94%A8"><span class="toc-number">1.0.1.</span> <span class="toc-text">内网安全学习从入门到入狱-神器-Cobalt Strike-二-Beacon简介和使用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#0x01%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%A8%E9%A9%AC%E6%89%93%E5%88%B0%E4%B8%80%E5%8F%B0PC"><span class="toc-number">1.1.</span> <span class="toc-text">0x01简单的木马打到一台PC</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%94%9F%E6%88%90win%E7%9A%84-Payload"><span class="toc-number">1.1.1.</span> <span class="toc-text">生成win的 Payload</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#0x02-beacon%E7%9A%84%E4%BB%8B%E7%BB%8D%E5%92%8C%E4%BD%BF%E7%94%A8"><span class="toc-number">1.2.</span> <span class="toc-text">0x02 beacon的介绍和使用</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Beacon%E7%AE%80%E4%BB%8B"><span class="toc-number">1.2.1.</span> <span class="toc-text">Beacon简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Beacon%E5%88%86%E7%B1%BB%EF%BC%9A"><span class="toc-number">1.2.2.</span> <span class="toc-text">Beacon分类：</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#http-beacon"><span class="toc-number">1.2.2.1.</span> <span class="toc-text">http beacon</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#DNS-beacon"><span class="toc-number">1.2.2.2.</span> <span class="toc-text">DNS beacon</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#SMB-beacon"><span class="toc-number">1.2.2.3.</span> <span class="toc-text">SMB beacon</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%9B%E5%85%A5beacon"><span class="toc-number">1.2.3.</span> <span class="toc-text">进入beacon</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AE%80%E5%8D%95%E7%9A%84%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C"><span class="toc-number">1.2.4.</span> <span class="toc-text">简单的命令执行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%80%E5%B8%B8%E7%94%A8%E7%9A%84%E4%BF%AE%E6%94%B9%E5%BF%83%E8%B7%B3%E5%8C%85"><span class="toc-number">1.2.5.</span> <span class="toc-text">最常用的修改心跳包</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nosql inject注入"/></a><div class="content"><a class="title" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入">Nosql inject注入</a><time datetime="2022-11-28T07:28:02.000Z" title="发表于 2022-11-28 15:28:02">2022-11-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="企业 SDLC 安全生命周期管理"/></a><div class="content"><a class="title" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理">企业 SDLC 安全生命周期管理</a><time datetime="2022-11-15T14:03:44.000Z" title="发表于 2022-11-15 22:03:44">2022-11-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计漏洞(File Operation\Redirect\Cors)"/></a><div class="content"><a class="title" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)">Go 代码审计漏洞(File Operation\Redirect\Cors)</a><time datetime="2022-11-05T09:15:28.000Z" title="发表于 2022-11-05 17:15:28">2022-11-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计高危漏洞(sqli\cmd\ssrf)"/></a><div class="content"><a class="title" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)">Go 代码审计高危漏洞(sqli\cmd\ssrf)</a><time datetime="2022-10-30T06:57:14.000Z" title="发表于 2022-10-30 14:57:14">2022-10-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java代码审计： ClassLoader应用"/></a><div class="content"><a class="title" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用">Java代码审计： ClassLoader应用</a><time datetime="2022-05-10T08:21:21.000Z" title="发表于 2022-05-10 16:21:21">2022-05-10</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2022 By Zeo</div><div class="footer_custom_text">Hi, welcome to my blog!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div></div></body></html>